%{
	int num_lines = 0,num_chars = 0;
%}
%option noyywrap
%%
\n	++num_lines; ++num_chars;
.	++num_chars;
%%

int main(int argc, char * argv[]) 
{
	char * buf="我是好人.";
	yy_switch_to_buffer(yy_scan_string(buf));
	yylex();
	printf("# of lines = %d, # of chars = %d\n", num_lines, num_chars);
	return 0;
}
